package uform.model.value;

import utest.Assert;

class TestBoolType extends Test
{
	public function testParse()
	{
		var value = new BoolType();
		Assert.isTrue(value.parse("YES"));
		Assert.isFalse(value.parse("N"));
		Assert.isTrue(value.parse("true"));
		Assert.isFalse(value.parse("false"));
	}
	
	public function testValidate()
	{
		var value = new BoolType();
		assertValidation(value.validate(true), true);
		assertValidation(value.validate(false), true);
	}
	
	public function testValidateType()
	{
		var value = new BoolType();
		assertValidation(value.validateType(true), true);
		assertValidation(value.validateType(false), true);
		assertValidation(value.validateType(0), false);
		assertValidation(value.validateType(""), false);
	}
	
	public function testRender()
	{
		var value = new BoolType();
		Assert.equals("true", value.render(true));
		Assert.equals("false", value.render(false));
	}
	
	public function new();
}